from app import db, app


class User(db.Model):
    __tablename__ = "users"
    user_id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)
    email = db.Column(db.String(120), unique=True, nullable=False)

    def __repr__(self):
        return f"User {self.username}, email: {self.email}"


if __name__ == "__main__":
    with app.app_context():
        db.drop_all()
        db.create_all()
